class Solution(object):
    def reorganizeString(self, s):
        from collections import Counter

        counter = Counter(s)
        max_freq = max(counter.values())
        if max_freq > (len(s) + 1) // 2:
            return ""

        result = [None] * len(s)
        even_idx, odd_idx = 0, 1
        for char, freq in counter.items():
            while freq > 0 and freq < len(s) // 2 + 1 and odd_idx < len(s):
                result[odd_idx] = char
                freq -= 1
                odd_idx += 2
            while freq > 0:
                result[even_idx] = char
                freq -= 1
                even_idx += 2

        return ''.join(result)